<!DOCTYPE html>
<html lang="zh">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no" />
<title>文献资源管理系统-参数管理</title>
<link rel="icon" href="favicon.ico" type="image/ico">
<meta name="keywords" content="文献资源管理系统-参数管理">
<meta name="description" content="文献资源管理系统-参数管理">
<meta name="author" content="yinqi">
<link href="css/bootstrap.min.css" rel="stylesheet">
<link href="css/materialdesignicons.min.css" rel="stylesheet">
<link href="css/style.min.css" rel="stylesheet">
<link href="icon/iconfont.css" rel="stylesheet">
<script src="https://cdn.bootcss.com/vue/2.6.9/vue.min.js"></script>
<script src="https://cdn.bootcss.com/axios/0.19.0/axios.min.js"></script>
 

</head>
  <style>
    .col-lg-12{
      margin: auto;
    top: 17px;
    left: 0;
    bottom: 0;
    right: 0;
    position: absolute;
    }
    .left {
        width: 40%;
        height: 600px;
        border: 0px solid #ccc;
        float:left;
    }
    .right {
        width: 40%;
        height: 600px;
        border: 0px solid #ccc;
        float:left;
    }
    .el-scrollbar .el-scrollbar__wrap {
      overflow-x: hidden;
      }
  </style>
<body>
<div class="lyear-layout-web" id="app">
  <div class="lyear-layout-container">
    <!--左侧导航-->

    <!--End 左侧导航-->
    
    <!--头部信息-->
 
    <!--End 头部信息 <i class="mdi mdi-pencil"></i>  class="iconfont iconall"-->
    
    <!--页面主要内容-->
    
    <main class="lyear-layout-content" >
      <h1>{{tt}}</h1>
      <div class="content_wrap">
        <div class="left">
          <div class="card-body">
            <form action="lyear_forms_elements.html" method="post" onsubmit="return false;">
              <div class="form-group">
                <label for="example-nf-email">题名</label>
                <input class="form-control" type="email" id="example-nf-email" v-model="purchase.title"  placeholder="题名">
              </div>
              <div class="form-group">
                <label for="example-nf-email">PISSN：</label>
                <input class="form-control" type="email" id="example-nf-email" v-model="purchase.pissn"  placeholder="PISSN">
              </div>
              <div class="form-group">
                <label for="example-nf-email">EISSN：</label>
                <input class="form-control" type="email" id="example-nf-email" v-model="purchase.eissn"  placeholder="EISSN">
              </div>
              <div class="form-group">
                <label for="example-nf-email">文献类型：</label>
                <select class="form-control" type="email" id="example-nf-email" v-model="purchase.type">
                  <option v-for="(it,index) in typee" :value="it.id">{{it.name}}</option>
                </select>
              </div>
              <div class="form-group">
                <label for="example-nf-email">作者</label>
                <input class="form-control" type="email" id="example-nf-email" v-model="purchase.author"  placeholder="作者">
              </div>
              <div class="form-group">
                <label for="example-nf-email">URL地址：</label>
                <input class="form-control" type="email" id="example-nf-email" v-model="purchase.url"  placeholder="URL地址">
              </div>
              <div class="form-group">
                <label for="example-nf-email">分类号：</label>
                <input class="form-control" type="email" id="example-nf-email" v-model="purchase.classiNumber"  placeholder="分类号">
              </div>
              <div class="form-group">
                <label for="example-nf-email">出版机构：</label>
                <input class="form-control" type="email" id="example-nf-email" v-model="purchase.publisher"  placeholder="出版机构">
              </div>
              <div class="form-group">
                <label for="example-nf-email">出版状态：</label>
                <select class="form-control" type="email" id="example-nf-email" v-model="purchase.pubStatus">
                    <option v-for="(it,index) in pubStatus" :value="it.id">{{it.name}}</option>    
                </select>
              </div>
              <div class="form-group">
                <label for="example-nf-email">价格：</label>
                <input class="form-control" type="email" id="example-nf-email" v-model="purchase.price"  placeholder="价格">
              </div>
              <div class="form-group">
                <label for="example-nf-email">订购号：</label>
                <input class="form-control" type="email" id="example-nf-email" v-model="purchase.orderNumber"  placeholder="订购号">
              </div>
              <div class="form-group">
                <label for="example-nf-email">是否印本转OA：</label>
                <span>
                    是<input  type="radio" v-model="purchase.oa" style="margin-left: 6px" checked  :value="1">
                </span>
                <span>
                    否<input  type="radio" v-model="purchase.oa" style="margin-left: 6px"   :value="0">
                </span>
              </div>
              <div class="form-group">
                <label for="example-nf-email">推荐理由：</label>
                <input class="form-control" type="email" id="example-nf-email" v-model="purchase.note"  placeholder="推荐理由">
              </div>
            </form>
          </div>
        </div>
     </div>
        </div>
        <div class="right">
          <div class="card-body">
            <form action="lyear_forms_elements.html" method="post" onsubmit="return false;">
              <div class="form-group">
                <label for="example-nf-email">套题名：</label>
                <input class="form-control" type="email" id="example-nf-email" v-model="purchase.otherTitle"  placeholder="套题名">
              </div>
              <div class="form-group">
                <label for="example-nf-email">PISBN</label>
                <input class="form-control" type="email" id="example-nf-email" v-model="purchase.pisbn"  placeholder="PISBN">
              </div>
              <div class="form-group">
                <label for="example-nf-email">EISBN</label>
                <input class="form-control" type="email" id="example-nf-email" v-model="purchase.eisbn"  placeholder="EISBN">
              </div>
              <div class="form-group">
                <label for="example-nf-email">题名译名：</label>
                <input class="form-control" type="email" id="example-nf-email" v-model="purchase.seriesTitle"  placeholder="题名译名">
              </div>
              <div class="form-group">
                <label for="example-nf-email">载体：</label>
                <select class="form-control" type="email" id="example-nf-email" v-model="purchase.carrier">
                  <option v-for="(it,index) in carrier" :value="it.id">{{it.name}}</option> 
                </select>
              </div>
              <div class="form-group">
                <label for="example-nf-email">学科</label>
                <select class="form-control" type="email" id="example-nf-email" v-model="purchase.subject">
                  <option v-for="(it,index) in subject" :value="it.id">{{it.name}}</option> 
                </select>
              </div>
              <div class="form-group">
                <label for="example-nf-email">国家/地区：</label>
                <select class="form-control" type="email" id="example-nf-email" v-model="purchase.country">
                  <option v-for="(it,index) in country" :value="it.id">{{it.name}}</option> 
                </select>
              </div>
              <div class="form-group">
                <label for="example-nf-email">出版频率：</label>
                <input class="form-control" type="email" id="example-nf-email" v-model="purchase.pubFeq"  placeholder="出版频率：">
              </div>
              <div class="form-group">
                <label for="example-nf-email">语种：</label>
                <select class="form-control" type="email" id="example-nf-email" v-model="purchase.language">
                  <option v-for="(it,index) in language" :value="it.id">{{it.name}}</option> 
                </select>
              </div>
              <div class="form-group">
                <label for="example-nf-email">货币：</label>
                <select class="form-control" type="email" id="example-nf-email" v-model="purchase.currency">
                  <option v-for="(it,index) in currency" :value="it.id">{{it.name}}</option> 
                </select>
              </div>
              <div class="form-group">
                <label for="example-nf-email">创刊年：</label>
                <input class="form-control" type="email" id="example-nf-email" v-model="purchase.foundedYear"  placeholder="创刊年">
              </div>
              <div class="form-group">
                <label for="example-nf-email">内容简介：</label>
                <input class="form-control" type="email" id="example-nf-email" v-model="purchase.intro"  placeholder="内容简介">
              </div>
              <div class="form-group">
                <a class="btn btn-primary m-r-5" type="warning" @click="add()"><i class="mdi mdi-check"></i> 保存</a>
               </div>  
            </form>
          </div>
        </div>
     </div>
    </main>
  </div>
</div>
<script>
  new Vue({
    el:"#app",
    data:{
        tt:"单条荐购详情页面",
        purchase:{
            title:"",//题名
            otherTitle:"",//套题名
            pissn:"",
            eissn:"",
            pisbn:"",
            eisbn:"",
            type:"",//文献类型
            seriesTitle:"",//分辑名 题名译名
            author:"",//作者
            carrier:"",//载体
            url:"",//url地址
            subject:"",//学科
            classiNumber:"",//分类号
            country:"",//国别
            publisher:"",//出版机构  出版社
            pubFeq:"",//出版频率
            pubStatus:"",//出版状态
            language:"",//语种
            price:"",//价格
            currency:"",//货币
            orderNumber:"",//订单号
            foundedYear:"",//创刊年
            oa:"",//是否转自oa
            intro:"",//内容简介
            note:""//荐购原因
        },
        typee:[],
        subject:[],
        carrier:[],
        pubStatus:[],
        currency:[],
        country:[],
        language:[],
        param:{},
        id:""

    },
    created () {
         this.id=window.localStorage.getItem("id");
         this.hx();
         this.selectSubject();
         this.selectType();
         this.selectCarrier();
         this.selectPubStatus();
         this.selectCurrency();
         this.selectCountry();
         this.selectLanguage();
 
    },
    methods: {
        hx(){
          axios.get("http://localhost:9004/purchase/selectPurchaseById?id="+this.id).then(res=>{
                   console.log(res);
                   if(res.data.flag){
                        this.purchase.title=res.data.data.title;
                        this.purchase.pisbn=res.data.data.pisbn;
                        this.purchase.eisbn=res.data.data.eisbn;
                        this.purchase.pissn=res.data.data.pissn;
                        this.purchase.eissn=res.data.data.eissn;
                   }
             })

        },
        ch(){
             this.purchase.classiNumber=this.purchase.oldId;
        },
        selectType(){
             axios.get("http://29n01o8660.oicp.vip/purchase/selectType").then(res=>{
                   console.log(res);
                   if(res.data.flag){
                        this.typee=res.data.data;
                   }
             })
        },
        selectSubject(){
             axios.get("http://29n01o8660.oicp.vip/purchase/selectSubject").then(res=>{
                   console.log(res);
                   if(res.data.flag){
                        this.subject=res.data.data;
                   }
             })
        },
        selectCarrier(){
             axios.get("http://29n01o8660.oicp.vip/purchase/selectCarrier").then(res=>{
                   console.log(res);
                   if(res.data.flag){
                        this.carrier=res.data.data;
                   }
             })
        },
        selectPubStatus(){
             axios.get("http://29n01o8660.oicp.vip/purchase/selectPubStatus").then(res=>{
                   console.log(res);
                   if(res.data.flag){
                        this.pubStatus=res.data.data;
                   }
             })
        },
        selectCurrency(){
             axios.get("http://29n01o8660.oicp.vip/purchase/selectCurrency").then(res=>{
                   console.log(res);
                   if(res.data.flag){
                        this.currency=res.data.data;
                   }
             })
        },
        selectCountry(){  
             axios.get("http://29n01o8660.oicp.vip/purchase/selectCountry").then(res=>{
                   console.log(res);
                   if(res.data.flag){
                        this.country=res.data.data;
                   }
             })
        },
        selectLanguage(){
             axios.get("http://29n01o8660.oicp.vip/purchase/selectLanguage").then(res=>{
                   console.log(res);
                   if(res.data.flag){
                        this.language=res.data.data;
                   } 
             })
        },
        add(){
            axios.post(`http://29n01o8660.oicp.vip/purchase/addPurchase`,this.purchase).then(res=>{
                if(res.data.flag){
                    location="purchaseAll.html";
                }
            })
        }
    }

           
             
  })
</script>
</body>
</html>